<template>
	<el-dialog :title="titleMap[mode]" v-model="visible" width="50%" destroy-on-close @closed="$emit('closed')" align-center :close-on-click-modal="false">
        <el-container>
            <el-main>
                    <sc-editor disabled v-model="sell_ask" placeholder="请输入" :height="450" ></sc-editor>
            </el-main>
            <el-footer>
                <div style="display:flex;justify-content: end;">
                    <el-button @click="visible=false" >取 消</el-button>
                </div>
            </el-footer>
        </el-container>
	</el-dialog>
</template>

<script>
import { defineAsyncComponent } from 'vue';
const scEditor = defineAsyncComponent(() => import('@/components/scEditor'));
	export default {
        components: {scEditor},
		emits: ['success', 'closed'],
		data() {
			return {
				mode: "add",
				titleMap: {
					add: '添加客户',
					edit: '查看要求',
					over: '查看要求'
				},
                sell_ask:"",
				visible: false,
				isSaveing: false,
			}
		},
		mounted() {
		},
		methods: {
			//显示
			open(mode='add'){
				this.mode = mode;
				this.visible = true;
				return this
			},
			//表单注入数据
			setData(data){
                this.sell_ask = data.sell_ask
			},
		}
	}
</script>

<style lang="scss">
.el-form-item--default{
    align-items: center;
}
</style>
